package com.zhoudy.segmetqueue;

import java.util.concurrent.CountDownLatch;

public class Worker implements Runnable {

    private CountDownLatch downLatch;
    private TransferDat transferDat;

    public Worker(TransferDat transferDat, CountDownLatch downLatch) {
        this.downLatch = downLatch;
        this.transferDat = transferDat;
    }

    @Override
    public void run() {
        transferDat.transfer();
        downLatch.countDown();
    }
}